package com.neo.rabbit.topic;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Component
public class TopicSender
{
    @Autowired
    private AmqpTemplate rabbitTemplate;
    
    public void send()
    {
        String context = "hi, i am message all";
        log.info("Sender : " + context);
        this.rabbitTemplate.convertAndSend("topicExchange", "topic.1", context);
    }
    
    public void send1()
    {
        String context = "hi, i am message 1";
        log.info("Sender : " + context);
        this.rabbitTemplate.convertAndSend("topicExchange", "topic.message", context);
    }
    
    public void send2()
    {
        String context = "hi, i am messages 2";
        log.info("Sender : " + context);
        this.rabbitTemplate.convertAndSend("topicExchange", "topic.messages", context);
    }
}